package com.fcscs.cservice.service.impl;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fcscs.core.common.ErrorEnums;
import com.fcscs.core.common.MainEnums;
import com.fcscs.core.domain.Property;
import com.fcscs.core.service.FcsManager;
import com.fcscs.core.service.PropertyManager;
import com.fcscs.core.util.CommonUtil;
import com.fcscs.cservice.common.CServiceCommonEnums.NotifType;
import com.fcscs.cservice.common.CServiceCommonEnums.TemplateType;
import com.fcscs.cservice.common.CServiceCommonUtils;
import com.fcscs.cservice.common.CServiceCommonEnums.EditableCategoryEnum;
import com.fcscs.cservice.common.CServiceCommonEnums.EditableFieldEnum;
import com.fcscs.cservice.common.CServiceCommonUtils.NotifEntityIntf;
import com.fcscs.cservice.communication.CommIntfAdaptor;
import com.fcscs.cservice.communication.OutboundHandler;
import com.fcscs.cservice.dao.CServiceCommonDao;
import com.fcscs.cservice.domain.AuthenticationConfig;
import com.fcscs.cservice.domain.ConstantsLanguageValue;
import com.fcscs.cservice.domain.Country;
import com.fcscs.cservice.domain.ExpressCheckInConfig;
import com.fcscs.cservice.domain.FieldEditability;
import com.fcscs.cservice.domain.HouseKeepingConfig;
import com.fcscs.cservice.domain.IGuestUserProfileView;
import com.fcscs.cservice.domain.IGuestUserView;
import com.fcscs.cservice.domain.InterfaceConfig;
import com.fcscs.cservice.domain.InterfaceConfiguration;
import com.fcscs.cservice.domain.Language;
import com.fcscs.cservice.domain.Nationality;
import com.fcscs.cservice.domain.NotifDestination;
import com.fcscs.cservice.domain.NotifTemplate;
import com.fcscs.cservice.domain.PaymentMethod;
//import com.fcscs.cservice.domain.ReservationStatus;
import com.fcscs.cservice.domain.RoomStatus;
import com.fcscs.cservice.domain.State;
import com.fcscs.cservice.domain.Title;
import com.fcscs.cservice.domain.model.CountryView;
import com.fcscs.cservice.domain.model.EditabilityConf;
import com.fcscs.cservice.domain.model.ReservationConfView;
import com.fcscs.cservice.domain.model.StateView;
import com.fcscs.cservice.domain.validator.CServiceCommonValidators;
import com.fcscs.cservice.service.CServiceCommonManager;

@Service("cServiceCommonManager")
public class CServiceCommonManagerImpl extends FcsManager implements CServiceCommonManager{

	@Autowired
	private CServiceCommonDao ccDao;

	@Autowired
	PropertyManager propMgr;
	
	@Autowired
	OutboundHandler outHdl;
	
	private static Logger LOGGER = Logger.getLogger(CServiceCommonManagerImpl.class);

	@Override
	public List<CountryView> getCountryViewList(long propId) {
		return ccDao.getCountryViewList(propId);
	}

	@Override
	public List<StateView> getStateViewList(long countryId) {
		return ccDao.getStateViewList(countryId);
	}

	@Override
	public ReservationConfView getRsvConfView(long orgId, long propId) {
		return ccDao.getRsvConfView(orgId, propId);
	}

	@Override
	public List<Country> getCountryList(long propId) {
		return ccDao.getCountryList(propId);
	}

	@Override
	public List<State> getStateList(long countryId) {
		return ccDao.getStateList(countryId);
	}

	@Override
	public List<Title> getTitleList(long propId) {
		return ccDao.getTitleList(propId);
	}

	@Override
	public List<Language> getLanguageList(long propId) {
		return ccDao.getLanguageList(propId);
	}

	@Override
	public List<PaymentMethod> getPayMethodList(long propId) {
		return ccDao.getPayMethodList(propId);
	}

	@Override
	public List<Nationality> getNationalityList(long propId) {
		return ccDao.getNationalityList(propId);
	}

	@Override
	public List<RoomStatus> getRoomStatusList(long propId) {
		return ccDao.getRoomStatusList(propId);
	}

/*	@Override
	public List<ReservationStatus> getRsvStatusList(long propId) {
		return ccDao.getRsvStatusList(propId);
	}*/

	@Override
	public String getCurrency(long propId) {
		return ccDao.getCurrency(propId);
	}

	@Override
	public Country getCountry(long id) {
		return ccDao.getCountry(id);
	}

	@Override
	public Country saveCountry(Country country) {
		if (country == null) {
			return country;
		}
		country.setOrgId(CommonUtil.getUserContext().getOrgId());
		country.setPropertyId(country.getPropertyId());
		Country update = country;
		if (!country.isNew()) {
			update = ccDao.getCountry(country.getId());
			update.setCountry(country.getCountry());
			update.setCountrySecLang(country.getCountrySecLang());
		}
		ErrorEnums err = new CServiceCommonValidators.CountryValidator().validate(country, country.isNew());
		if (err != null) {
			LOGGER.debug(err);
			return null;
		}
		if (ccDao.isCountryTaken(country.getPropertyId(), country.getCountry(), country.getId())) {
			LOGGER.debug(country.getCountry() + " " + ErrorEnums.GeneralError.UNIQUE_CONS);
			return null;
		}
		transferBaseVals(country, update, country.isNew());
		return ccDao.saveCountry(update);
	}

	@Override
	public State getState(long id) {
		return ccDao.getState(id);
	}

	@Override
	public State saveState(State state) {
		if (state == null) {
			return state;
		}
		state.setOrgId(CommonUtil.getUserContext().getOrgId());
		state.setPropertyId(state.getPropertyId());
		State update = state;
		if (!state.isNew()) {
			update = ccDao.getState(state.getId());
			update.setCountryId(state.getCountryId());
			update.setState(state.getState());
			update.setStateSecLang(state.getStateSecLang());
		}
		ErrorEnums err = new CServiceCommonValidators.StateValidator().validate(state, state.isNew());
		if (err != null) {
			LOGGER.debug(err);
			return null;
		}
		if (ccDao.isStateTaken(state.getPropertyId(), state.getCountryId(), state.getState(), state.getId())) {
			LOGGER.debug(state.getState() + " " + ErrorEnums.GeneralError.UNIQUE_CONS);
			return null;
		}
		transferBaseVals(state, update, state.isNew());
		return ccDao.saveState(update);
	}

	@Override
	public Title getTitle(long id) {
		return ccDao.getTitle(id);
	}

	@Override
	public Title saveTitle(Title title) {
		if (title == null) {
			return title;
		}
		title.setOrgId(CommonUtil.getUserContext().getOrgId());
		title.setPropertyId(title.getPropertyId());
		Title update = title;
		if (!title.isNew()) {
			update = ccDao.getTitle(title.getId());
			update.setTitle(title.getTitle());
			update.setTitleSecLang(title.getTitleSecLang());
		}
		ErrorEnums err = new CServiceCommonValidators.TitleValidator().validate(title, title.isNew());
		if (err != null) {
			LOGGER.debug(err);
			return null;
		}
		if (ccDao.isTitleTaken(title.getOrgId(), title.getTitle(), title.getId())) {
			LOGGER.debug(title.getTitle() + " " + ErrorEnums.GeneralError.UNIQUE_CONS);
			return null;
		}
		transferBaseVals(title, update, title.isNew());
		return ccDao.saveTitle(update);
	}

	@Override
	public Language getLanguage(long id) {
		return ccDao.getLanguage(id);
	}

	@Override
	public Language saveLanguage(Language language) {
		if (language == null) {
			return language;
		}
		language.setOrgId(CommonUtil.getUserContext().getOrgId());
		language.setPropertyId(language.getPropertyId());
		Language update = language;
		if (!language.isNew()) {
			update = ccDao.getLanguage(language.getId());
			update.setLanguage(language.getLanguage());
			update.setLanguageSecLang(language.getLanguageSecLang());
		}
		ErrorEnums err = new CServiceCommonValidators.LanguageValidator().validate(language, language.isNew());
		if (err != null) {
			LOGGER.debug(err);
			return null;
		}
		if (ccDao.isLanguageTaken(language.getPropertyId(), language.getLanguage(), language.getId())) {
			LOGGER.debug(language.getLanguage() + " " + ErrorEnums.GeneralError.UNIQUE_CONS);
			return null;
		}
		transferBaseVals(language, update, language.isNew());
		return ccDao.saveLanguage(update);
	}

	@Override
	public PaymentMethod getPayMethod(long id) {
		return ccDao.getPayMethod(id);
	}

	@Override
	public PaymentMethod savePayMethod(PaymentMethod payMethod) {
		if (payMethod == null) {
			return payMethod;
		}
		payMethod.setOrgId(CommonUtil.getUserContext().getOrgId());
		payMethod.setPropertyId(payMethod.getPropertyId());
		PaymentMethod update = payMethod;
		if (!payMethod.isNew()) {
			update = ccDao.getPayMethod(payMethod.getId());
			update.setMethod(payMethod.getMethod());
			update.setMethodSecLang(payMethod.getMethodSecLang());
		}
		ErrorEnums err = new CServiceCommonValidators.PayMethodValidator().validate(payMethod, payMethod.isNew());
		if (err != null) {
			LOGGER.debug(err);
			return null;
		}
		if (ccDao.isPayMethodTaken(payMethod.getPropertyId(), payMethod.getMethod(), payMethod.getId())) {
			LOGGER.debug(payMethod.getMethod() + " " + ErrorEnums.GeneralError.UNIQUE_CONS);
			return null;
		}
		transferBaseVals(payMethod, update, payMethod.isNew());
		return ccDao.savePayMethod(update);
	}

	@Override
	public Nationality getNationality(long id) {
		return ccDao.getNationality(id);
	}

	@Override
	public Nationality saveNationality(Nationality nationality) {
		if (nationality == null) {
			return nationality;
		}
		nationality.setOrgId(CommonUtil.getUserContext().getOrgId());
		nationality.setPropertyId(nationality.getPropertyId());
		Nationality update = nationality;
		if (!nationality.isNew()) {
			update = ccDao.getNationality(nationality.getId());
			update.setNationality(nationality.getNationality());
			update.setNationalitySecLang(nationality.getNationalitySecLang());
		}
		ErrorEnums err = new CServiceCommonValidators.NationalityValidator().validate(nationality, nationality.isNew());
		if (err != null) {
			LOGGER.debug(err);
			return null;
		}
		if (ccDao.isNationalityTaken(nationality.getPropertyId(), nationality.getNationality(), nationality.getId())) {
			LOGGER.debug(nationality.getNationality() + " " + ErrorEnums.GeneralError.UNIQUE_CONS);
			return null;
		}
		transferBaseVals(nationality, update, nationality.isNew());
		return ccDao.saveNationality(update);
	}

	@Override
	public RoomStatus getRoomStatus(long id) {
		return ccDao.getRoomStatus(id);
	}

	@Override
	public RoomStatus saveRoomStatus(RoomStatus roomStatus) {
		if (roomStatus == null) {
			return roomStatus;
		}
		roomStatus.setOrgId(CommonUtil.getUserContext().getOrgId());
		roomStatus.setPropertyId(CommonUtil.getUserContext().getPropertyId());
		RoomStatus update = roomStatus;
		if (!roomStatus.isNew()) {
			update = ccDao.getRoomStatus(roomStatus.getId());
			update.setRoomStatus(roomStatus.getRoomStatus());
			update.setRoomStatusSecLang(roomStatus.getRoomStatusSecLang());
			update.setColorCode(roomStatus.getColorCode());
		}
		ErrorEnums err = new CServiceCommonValidators.RoomStatusValidator().validate(roomStatus, roomStatus.isNew());
		if (err != null) {
			LOGGER.debug(err);
			return null;
		}
		if (ccDao.isRoomStatusTaken(roomStatus.getPropertyId(), roomStatus.getRoomStatus(), roomStatus.getId())) {
			LOGGER.debug(roomStatus.getRoomStatus() + " " + ErrorEnums.GeneralError.UNIQUE_CONS);
			return null;
		}
		transferBaseVals(roomStatus, update, roomStatus.isNew());
		return ccDao.saveRoomStatus(update);
	}

/*	@Override
	public ReservationStatus getReservationStatus(long id) {
		return ccDao.getReservationStatus(id);
	}

	@Override
	public ReservationStatus saveReservationStatus(ReservationStatus rsvStatus) {
		if (rsvStatus == null) {
			return rsvStatus;
		}
		rsvStatus.setOrgId(CommonUtil.getUserContext().getOrgId());
		rsvStatus.setPropertyId(CommonUtil.getUserContext().getPropertyId());
		ReservationStatus update = rsvStatus;
		if (!rsvStatus.isNew()) {
			update = ccDao.getReservationStatus(rsvStatus.getId());
			update.setStatus(rsvStatus.getStatus());
			update.setStatusSecLang(rsvStatus.getStatusSecLang());
		}
		ErrorEnums err = new CServiceCommonValidators.RsvStatusValidator().validate(rsvStatus, rsvStatus.isNew());
		if (err != null) {
			LOGGER.debug(err);
			return null;
		}
		if (ccDao.isRoomStatusTaken(rsvStatus.getPropertyId(), rsvStatus.getStatus(), rsvStatus.getId())) {
			LOGGER.debug(rsvStatus.getStatus() + " " + ErrorEnums.GeneralError.UNIQUE_CONS);
			return null;
		}
		transferBaseVals(rsvStatus, update, rsvStatus.isNew());
		return ccDao.saveReservationStatus(update);
	}*/

	@Override
	public boolean isCountryTaken(long propId, String country, Long id) {
		return ccDao.isCountryTaken(propId, country, id);
	}

	@Override
	public boolean isStateTaken(long propId, long countryId, String state, Long id) {
		return ccDao.isStateTaken(propId, countryId, state, id);
	}

	@Override
	public boolean isTitleTaken(long propId, String title, Long id) {
		return ccDao.isTitleTaken(propId, title, id);
	}

	@Override
	public boolean isLanguageTaken(long propId, String language, Long id) {
		return ccDao.isLanguageTaken(propId, language, id);
	}

	@Override
	public boolean isNationalityTaken(long propId, String nationality, Long id) {
		return ccDao.isNationalityTaken(propId, nationality, id);
	}

	@Override
	public boolean isPayMethodTaken(long propId, String method, Long id) {
		return ccDao.isPayMethodTaken(propId, method, id);
	}

	@Override
	public boolean isRsvStatusTaken(long propId, String status, Long id) {
		return ccDao.isRsvStatusTaken(propId, status, id);
	}

	@Override
	public boolean isRoomStatusTaken(long propId, String status, Long id) {
		return ccDao.isRoomStatusTaken(propId, status, id);
	}

	@Override
	public boolean isPropertyConfTaken(long orgId, long propId, Long id) {
		return ccDao.isPropertyConfTaken(orgId, propId, id);
	}

	@Override
	public EditabilityConf getEditabilityConf(long orgId, long propId, List<EditableCategoryEnum> categories) {
		List<FieldEditability> fieldEditList = ccDao.getFieldEditability(orgId, propId, categories);
		Collections.sort(fieldEditList, FieldEditability.getComparator());

		EditabilityConf conf = new EditabilityConf();
		if (categories == null) {
			categories = Arrays.asList(EditableCategoryEnum.values());
		}
		for (EditableCategoryEnum cat : categories) {
			conf.setEditableFieldList(cat, transEditList(fieldEditList, cat));
		}
		return conf;
	}

	private List<FieldEditability> transEditList(List<FieldEditability> editList, EditableCategoryEnum category) {
		List<FieldEditability> result = new ArrayList<FieldEditability>();
		if (editList == null) {
			editList = new ArrayList<FieldEditability>(0);
		}
		List<EditableFieldEnum> fields = category.getFieldList();
		for (EditableFieldEnum fd : fields) {
			int index = FieldEditability.binarySearch(editList, category, fd);
			if (index >= 0) {
				result.add(editList.get(index));
			} else {
				FieldEditability tempFdEdit = new FieldEditability();
				tempFdEdit.setCategoryEnum(category);
				tempFdEdit.setFieldEnum(fd);
				result.add(tempFdEdit);
			}
		}
		return result;
	}

	@Override
	public List<FieldEditability> updateFieldEditability(List<FieldEditability> fieldEditList) {
		if (fieldEditList == null) {
			return fieldEditList;
		}
		Set<Long> ids = new HashSet<Long>();
		for (FieldEditability fe : fieldEditList) {
			if (!fe.isNew()) {
				ids.add(fe.getId());
			}
		}
		Map<Long, FieldEditability> getMap = ccDao.getFieldEditability(ids);

		long orgId = CommonUtil.getUserContext().getOrgId();
		long propId = CommonUtil.getUserContext().getPropertyId();
		List<FieldEditability> saveList = new ArrayList<FieldEditability>(fieldEditList.size());
		CServiceCommonValidators.FieldEditabilityValidator validator = new CServiceCommonValidators.FieldEditabilityValidator();
		for (FieldEditability fe : fieldEditList) {
			propId = fe.getPropertyId();
			if (validator.validate(fe, fe.isNew()) != null) {
				return null;
			}
			if (!fe.isNew()) {
				FieldEditability update = getMap.get(fe.getId());
				update.setCategory(fe.getCategory());
				update.setField(fe.getField());
				update.setEditable(fe.getEditable());
				transferBaseVals(update, update, false);
				saveList.add(update);
			} else {
				fe.setOrgId(orgId);
				fe.setPropertyId(propId);
				transferBaseVals(fe, fe, true);
				saveList.add(fe);
			}
		}

		return ccDao.updateFieldEditability(saveList);
	}

	@Override
	public boolean deleteCountry(Country country) {
		return ccDao.deleteCountry(country);
	}

	@Override
	public void permDeleteCountry(Country country) {
		ccDao.permDeleteCountry(country);
	}

	@Override
	public boolean deleteState(State state) {
		return ccDao.deleteState(state);
	}

	@Override
	public void permDeleteState(State state) {
		ccDao.permDeleteState(state);
	}

	@Override
	public boolean deleteTitle(Title title) {
		return ccDao.deleteTitle(title);
	}

	@Override
	public void permDeleteTitle(Title title) {
		ccDao.permDeleteTitle(title);
	}

	@Override
	public boolean deleteLanguage(Language language) {
		return ccDao.deleteLanguage(language);
	}

	@Override
	public void permDeleteLanguage(Language language) {
		ccDao.permDeleteLanguage(language);
	}

	@Override
	public boolean deleteNationality(Nationality nationality) {
		return ccDao.deleteNationality(nationality);
	}

	@Override
	public void permDeleteNationality(Nationality nationality) {
		ccDao.permDeleteNationality(nationality);
	}

	@Override
	public boolean deletePayMethod(PaymentMethod method) {
		return ccDao.deletePayMethod(method);
	}

	@Override
	public void permDeletePayMethod(PaymentMethod method) {
		ccDao.permDeletePayMethod(method);
	}

/*	@Override
	public boolean deleteRsvStatus(ReservationStatus status) {
		return ccDao.deleteRsvStatus(status);
	}

	@Override
	public void permDeleteRsvStatus(ReservationStatus status) {
		ccDao.permDeleteRsvStatus(status);
	}*/

	@Override
	public boolean deleteRoomStatus(RoomStatus status) {
		return ccDao.deleteRoomStatus(status);
	}

	@Override
	public void permDeleteRoomStatus(RoomStatus status) {
		ccDao.permDeleteRoomStatus(status);
	}

	@Override
	public InterfaceConfiguration saveInterfaceConf(InterfaceConfiguration conf) {
		if(null == conf){
            return conf;			
		}
		InterfaceConfiguration update = null;
		if(conf.getId() != null){
			update = ccDao.getInterfaceConf(conf.getId());
		}else{
			update = new InterfaceConfiguration();
			update.setOrgId(conf.getOrgId());
			update.setPropertyId(conf.getPropertyId());
		}
		update.setEconnect_ws_url(conf.getEconnect_ws_url());
		update.setEconnect_username(conf.getEconnect_username());
		update.setEconnect_passwd(conf.getEconnect_passwd());
		update.setCconnect_ws_url(conf.getCconnect_ws_url());
		update.setCconnect_username(conf.getCconnect_username());
		update.setCconnect_passwd(conf.getCconnect_passwd());
		update.setUnicorn_ws_url(conf.getUnicorn_ws_url());
		update.setUnicorn_cservice_device_id(conf.getUnicorn_cservice_device_id());
		update.setUnicorn_mservice_device_id_from(conf.getUnicorn_mservice_device_id_from());
		update.setUnicorn_mservice_device_id_to(conf.getUnicorn_mservice_device_id_to());
		update.setEmail_smtp_server(conf.getEmail_smtp_server());
		update.setEmail_smtp_account(conf.getEmail_smtp_account());
		update.setEmail_smtp_passwd(conf.getEmail_smtp_passwd());
		update.setLogout_idle_time(conf.getLogout_idle_time());
		
		transferBaseVals(update, update, update.isNew());
		return ccDao.saveInterfaceConf(update);
	}

	@Override
	public InterfaceConfiguration getInterfaceConf(long orgId, long propId) {
		return ccDao.getInterfaceConf(orgId, propId);
	}
	
	@Override
	public boolean sendRequest(long orgId, long propId, NotifType notifType, TemplateType tmplType, MainEnums.Language language, NotifEntityIntf obj) {
		List<NotifDestination> destList = ccDao.getNotifDestinations(orgId, propId, notifType);
		List<NotifTemplate> tmplList = ccDao.getNotifTemplates(orgId, propId, tmplType);
		NotifTemplate tmpl = null;
		language = language == null ? MainEnums.Language.ENGLISH : language;
		for (NotifTemplate t : tmplList) {
			if (language.equals(t.getLanguageEnum())) {
				tmpl = t;
			}
		}
		if (tmpl == null || destList == null) {
			LOGGER.warn("No notif configuration found for " + notifType + ", " + tmplType);
			return false;
		}
		StringBuilder titleBuilder = new StringBuilder();
		CServiceCommonUtils.parseTemplate(tmpl.getTitle(), obj, titleBuilder);
		StringBuilder detailBuilder = new StringBuilder();
		CServiceCommonUtils.parseTemplate(tmpl.getDetail(), obj, detailBuilder);
		Property p = propMgr.getProperty(propId);
		boolean result = true; //TODO
		for (NotifDestination dest : destList) {
			Map<CommIntfAdaptor.CommParam, Serializable> params = new HashMap<CommIntfAdaptor.CommParam, Serializable>();
			params.put(CommIntfAdaptor.CommParam.DEVICE, dest.getDestination());
			params.put(CommIntfAdaptor.CommParam.TITLE, titleBuilder.toString());
			params.put(CommIntfAdaptor.CommParam.FONT_SIZE, CommIntfAdaptor.DEFAULT_FONT_SIZE);
			params.put(CommIntfAdaptor.CommParam.MSG_TYPE, notifType.toString());
			params.put(CommIntfAdaptor.CommParam.PROP_IP, p.getIp());
			if (outHdl.sendBytes(p.getIp(), dest.getDestTypeEnum().getCommAdaptorEnum(), dest.getDestination(), detailBuilder.toString().getBytes(), params) != null) {
				result = true;
			}
		}
		return result;
	}

	@Override
	public List<IGuestUserView> getListIGuestUserView() {
		// TODO Auto-generated method stub
		return ccDao.getListIGuestUserView();
	}
	//iGuest Authen
		@Override
		public boolean isAuthenTaken(long propId, int authen, Long id) {
			return ccDao.isAuthenTaken(propId, authen, id);
		}
		@Override
		public AuthenticationConfig getAuthenticationConfig(long propId, long orgId) {
			return ccDao.getAuthen(propId,orgId);
		}

//		@Override
//		public AuthenticationConfig SaveAuthen(AuthenticationConfig authen) {
//			// TODO Auto-generated method stub
//			return null;
//		}

		@Override
		public AuthenticationConfig SaveAuthen(AuthenticationConfig authen) {
			if (authen == null) {
				return authen;
			}
			authen.setOrgId(CommonUtil.getUserContext().getOrgId());
			authen.setPropertyId(authen.getPropertyId());
			AuthenticationConfig update = authen;
			if (!authen.isNew()) {
				update = ccDao.getAuthen(authen.getPropertyId(),authen.getOrgId());
				update.setLoginOption(authen.getLoginOption());
				update.setUsername(authen.getUsername());
			}

			return ccDao.SaveAuthen(update);
		}
		
	//MultiLanguage
	@Override
	public Map<String, String> getLanguageMap() {
		// TODO Auto-generated method stub
		return ccDao.getLanguageMap();
	}

	@Override
	public IGuestUserProfileView getIGuestUserProfileView() {
		// TODO Auto-generated method stub
		return ccDao.getIGuestUserProfileView();
	}

	@Override
	public ExpressCheckInConfig saveExpressCheckInConfig(
			ExpressCheckInConfig expressCheckIn) {
		// TODO Auto-generated method stub
		return ccDao.saveExpressCheckInConfig(expressCheckIn);
	}

	@Override
	public ExpressCheckInConfig getExpressCheckInConfig(long id) {
		// TODO Auto-generated method stub
		return ccDao.getExpressCheckInConfig(id);
	}

	@Override
	public ConstantsLanguageValue saveConstantsLanguageValue(
			ConstantsLanguageValue constants) {
		// TODO Auto-generated method stub
		return ccDao.saveConstantsLanguageValue( constants);
	}

	@Override
	public List<ConstantsLanguageValue> getListConstantsLanguage(long propId,
			long orgId,String constants) {
		// TODO Auto-generated method stub
		return ccDao.getListConstantsLanguage(propId,orgId, constants);
	}

	@Override
	public HouseKeepingConfig saveHousepeepingConfig(
			HouseKeepingConfig currentHousekeepingConf) {
		// TODO Auto-generated method stub
		return ccDao.saveHousepeepingConfig(currentHousekeepingConf);
	}

	@Override
	public HouseKeepingConfig getHousekeepingConfig(long propertyId) {
		// TODO Auto-generated method stub
		return ccDao.getHousekeepingConfig(propertyId);
	}

	@Override
	public InterfaceConfig getInterfaceConfig(Long propertyId) {
		// TODO Auto-generated method stub
		return ccDao.getInterfaceConfig(propertyId);
	}

	@Override
	public InterfaceConfig saveInterfaceConfig(InterfaceConfig currentInterConf) {
		// TODO Auto-generated method stub
		return ccDao.saveInterfaceConfig(currentInterConf);
	}
}
